package MULE.Model.Panel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.JPanel;

import MULE.Model.Logic.MuleDriver;

/**
 * The game's dialogue panel. This panel is displayed in the main game panel and
 * displays game information.
 * 
 * @author jstep
 */
public class GameStatusPanel extends JPanel {

	private final int HEIGHT = 25;
	private JLabel textLabel;

	/**
	 * Creates a new dialogue panel.
	 */
	public GameStatusPanel() {
		// Initialize panel.
		this.setLayout(new FlowLayout(FlowLayout.CENTER));
		this.setBackground(Color.WHITE);
		Dimension dim = new Dimension(MuleDriver.WINDOW_WIDTH, HEIGHT);
		this.setMinimumSize(dim);
		this.setPreferredSize(dim);
		this.setMaximumSize(dim);
		// Add text label.
		textLabel = new JLabel();
		textLabel.setFont(new Font("Verdana", Font.PLAIN, 12));
		this.add(textLabel);
	}

	/**
	 * Sets the dialogue text.
	 * 
	 * @param text
	 *            Text to show in dialogue.
	 */
	public void setText(String text) {
		textLabel.setText(text);
		// repaint(); // need to call?
	}
}
